package com.tbit.uqbike.service.business.impl;

import com.tbit.uqbike.object.pojo.AccountPhoneLogin;
import com.tbit.uqbike.service.business.AccountPhoneLoginService;
import com.tbit.uqbike.webmanager.dao.core.AccountPhoneLoginDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author jing
 * @date 2020/11/1114:37
 * @Description:
 */
@Service("accountPhoneLoginService")
public class AccountPhoneLoginServiceImpl implements AccountPhoneLoginService {
    @Autowired
    private AccountPhoneLoginDao accountPhoneLoginDao;

    @Override
    public AccountPhoneLogin getAccountPhoneLogin(AccountPhoneLogin phoneLogin) {
        return accountPhoneLoginDao.select(phoneLogin);
    }

    @Override
    public void editAccountPhoneLogin(AccountPhoneLogin phoneLogin) {
        AccountPhoneLogin login = accountPhoneLoginDao.select(phoneLogin);
        if (null == login) {
            accountPhoneLoginDao.insert(phoneLogin);
        } else {
            accountPhoneLoginDao.update(phoneLogin);
        }
    }
}
